home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr49
/
352_01.zip
/
VECRECT.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-10
|
628b
|
35 lines
// VECRECT.CPP
// routines for rect 2 polar conversion.
// applies to complex vectors.
#include <stdlib.h>
#include "wtwg.h"
#include "dblib.h"
#include "vector.h"
void ToRect ( complex& z )
{
z=polar(real(z), imag(z));
};
void CVector::ToRect ( void )
{
if ( !ispolar ) return;
int vn = x.n;
float *xv = x.v;
float *yv = y.v;
complex rect;
while ( --vn >= 0 );
{
rect = polar (*xv, *yv);
*(xv++) = real (rect);
*(yv++) = imag(rect);
}
ispolar = OFF;
return; // CVector::ToRect ()
}
// ----------------- end of VECRECT.CPP -------------------------